  <link rel="stylesheet" type="text/css" href="__ADMIN__/lib/webuploader/0.1.5/webuploader.css">
  <link rel="stylesheet" type="text/css" href="__ADMIN__/lib/Validform_v5.3.2/css/style.css">
<body style="background-color:#fff"> 
  <article class="page-container"> 
	  <form class="form form-horizontal" id="form-article-add" method="post" action="{{:url('/admin/article/'.$art.id)}}">
		  <input type="hidden" name="_method" value="put"> 
    <div class="row cl"> 
     <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label> 
     <div class="formControls col-xs-8 col-sm-9"> 
	     <input type="text" class="input-text" name="title" value="{{$art.title}}" datatype="s6-20" errormsg="请填写长度为6-20的标题" /> 
     </div> 
    </div> 
    <div class="row cl"> 
     <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章分类：</label> 
     <div class="formControls col-xs-2 col-sm-2"> 
      <span class="select-box"> 
	      <select name="cat_id" class="select"> 
		      {volist name="cats" id="vo"}
		      {if($art.cat_id==$vo.id)}
		      	<option value="{{$vo.id}}" selected>{{$vo.cat_name}}</option> 
		      {else/}
			<option value="{{$vo.id}}">{{$vo.cat_name}}</option>
		      {/if}
		      {/volist}
      		</select> 
	</span> 
     </div> 
     <label class="form-label col-xs-4 col-sm-2">文章标签：</label> 
     <div class="formControls col-xs-2 col-sm-2"> 
	     <input type="text" class="input-text" value="{{$art.tag}}" datatype="s2-8" nullmsg="请输入文章标签"  id="keywords" name="tag" /> 
     </div> 
     <label class="form-label col-xs-4 col-sm-2">文章作者：</label> 
     <div class="formControls col-xs-1 col-sm-1"> 
	     <input type="text" class="input-text" name="author" value="{{$art.author}}" nullmsg="请输入文章作者" datatype="s2-6" /> 
     </div> 
    </div> 
    <div class="row cl"> 
     <label class="form-label col-xs-4 col-sm-2">文章摘要：</label> 
     <div class="formControls col-xs-8 col-sm-9"> 
	     <textarea name="summary" cols="" rows="" class="textarea" placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="文章摘要不能为空" >{{$art.summary}}</textarea> 
      <p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p> 
     </div> 
    </div> 
    <div class="row cl"> 
     <label class="form-label col-xs-4 col-sm-2">缩略图：</label> 
     <div class="formControls col-xs-8 col-sm-9"> 
      <div class="uploader-thum-container"> 
       <div id="fileList" class="uploader-list"></div> 
       <div id="filePicker">
        选择图片
       </div> 
		<div class="formControls col-xs-offset-4" id="img" style="width:250px;height:150px;border:1px dashed #333"> 
			<img src="/{{$art.img_url}}" />
		</div>

      </div> 
     </div> 
    </div> 
    <div class="row cl"> 
     <label class="form-label col-xs-4 col-sm-2">文章内容：</label> 
     <div class="formControls col-xs-8 col-sm-9"> 
	     <script id="editor" name="contents" type="text/plain" style="width:100%;height:400px;">{{$art.contents}}</script> 
     </div> 
    </div> 
    <div class="row cl"> 
     <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2"> 
      <button onclick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i> 更新并提交审核</button> 
      <button onclick="article_save();" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont"></i> 保存草稿</button> 
      <button onclick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button> 
     </div> 
    </div> 
   </form> 
  </article> 
  <!--请在下方写此页面业务相关的脚本--> 
  <script type="text/javascript" src="__ADMIN__/lib/webuploader/0.1.5/webuploader.min.js"></script> 
  <script type="text/javascript" src="__ADMIN__/lib/Validform_v5.3.2/js/Validform_v5.3.2_min.js"></script> 
  <script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.config.js"></script> 
  <script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
  <script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script> 
  <script type="text/javascript">
</script> 
<script>
// 初始化Web Uploader
var uploader = WebUploader.create({

    // 选完文件后，是否自动上传。
    auto: true,

    // swf文件路径
    swf: "__ADMIN__/lib/webuploader/0.1.5/Uploader.swf",

    // 文件接收服务端。
    server: "{{:url('/admin/upArtImg')}}",

    // 选择文件的按钮。可选。
    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
    pick: '#filePicker',

    // 只允许选择图片文件。
    accept: {
        title: 'Images',
        extensions: 'gif,jpg,jpeg,bmp,png',
        mimeTypes: 'image/*'
    }
});

// 文件上传成功，给item添加成功class, 用样式标记上传成功。
uploader.on( 'uploadSuccess', function( file ,data) {
	if(data.status=='fail'){
		$('#img').html('<span style="color:red">'+data.info+'</span>');	
		
	}else{
	$('#img').html('<img src=/'+data.info+'><input type="hidden" name="img_url" value="'+data.info+'">');
	
	}
 });


var ue = UE.getEditor('editor',{
	toolbars:[['undo', 'redo','bold', 'italic', 'underline', 'forecolor', 'backcolor','customstyle', 'paragraph', 'fontfamily', 'fontsize','justifyleft', 'justifycenter', 'justifyright', 'justifyjustify','simpleupload','insertcode','emotion']],
	autoHeightEnabled:false
	

});

$(".form").Validform();

</script>
 </body>
</html>
